<?php
//
// +------------------------------------------------------------------------+
// | PHP Version 5                                                          |
// +------------------------------------------------------------------------+
// | Copyright (c) All rights reserved.                                     |
// +------------------------------------------------------------------------+
// | This source file is subject to version 3.00 of the PHP License,        |
// | that is available at http://www.php.net/license/3_0.txt.               |
// | If you did not receive a copy of the PHP license and are unable to     |
// | obtain it through the world-wide-web, please send a note to            |
// | license@php.net so we can mail you a copy immediately.                 |
// +------------------------------------------------------------------------+
// | Author:                                                                |
// +------------------------------------------------------------------------+
//
// $Id$
//


/**
 * @author       mk
 */
abstract class BaseDriver {
    
    /**
     * @var      array
     */
    protected $config;
    
    protected $prefix = null;
    
    /**
     * @param    array $config    
     */
    public function __construct($config) { }
    
    /**
     * @param    string $sql    
     * @return   PdoRecordSet
     */
    abstract public function query($sql);
    
    /**
     * @param    string $sql    
     * @return   int
     */
    abstract public function exec($sql);
    
    /**
     * @param    string $table    
     * @param    array $record    
     * @return   int
     */
    abstract public function update($table, $record, $condition);
    
    /**
     * @param    string $table    
     * @param    array $record    
     * @return   int
     */
    abstract public function insert($table, $record);
    
    /**
     * @param    string $table    
     * @param    array $condition    
     * @return   PdoRecordSet
     */
    abstract public function select($table, $condition = array(), $fields = '*', $limit = null, $order = null);
    
    /**
     * @param    string $table    
     * @param    array $condition    
     * @return   int
     */
    abstract public function delete($table, $condition);
    /**
     * 取得数据库连接
     *
     * @return mixed
     */
    abstract public function getConnection();
}

?>